@ECHO off

:start
cls
ECHO This batch file will uninstall the AdvWorksSalesOrders publication. 
ECHO WARNING: Publishing and distribution will also be uninstalled. 
ECHO If you have other publication or subscriptions that use %ComputerName% 
ECHO as a Publisher or Distributor, remove the AdvWorkSalesOrders
ECHO publication using SQL Server Management Studio.

set choice=
set /p choice="Do you want to remove all replication components from %ComputerName%? [y,n] "
if not '%choice%'=='' set choice=%choice:~0,1%
if /I '%choice%'=='y' goto remove
if /I '%choice%'=='n' goto end
goto start

:remove
sqlcmd -iDropAdvWorksSalesOrdersPublication.sql -b -V10

:end
PAUSE